<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="br.sceweb.dominio.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Login</title>
<link rel="stylesheet" type="text/css"
	href="/sce-web-ref/CSS/formato.css">
<style type="text/css">
label {
	font: normal 12px courier !important;
}
</style>
<script type="text/javascript" language="javascript">
	function voltar() {
		history.go(-1);
	}
</script>
</head>
<body>
	<jsp:include page="Cabecalho.jsp" />
	<div id="principal">
		<div id="titulo">
			<h3>Consultar Usuário</h3>
		</div>
		<hr>

		<div id="formulario3">
			<form name="frmConsultarUsu" action="/sce-web-ref2/ServletControle"
				method="post">
				<table id="tabcampos">
					<tr>
						<td><label id="lblNome">Nome:</label></td>
						<td><input type="text" id="txtDado" name="txtDado" /></td>
					</tr>
					<tr>
						<td><label id="lblCPF">CPF: </label></td>
						<td><input type="text" id="txtDado2" name="txtDado2" /></td>

					</tr>
					<tr>
						<td><input type="submit" id="btnNome" name="btnNome"
							value="Consultar" /> <input type="hidden" name="acao"
							value="ConsultarUsuario"></td>
						<td><input type="button" value="Cancelar" onclick="voltar()" /></td>

					</tr>
				</table>
				<%
					String erro = (String) request.getAttribute("erro");
					if (erro == null)
						erro = "";
				%>
				<label><%=erro%></label>


			</form>
			<%
				Usuario usuario = (Usuario) request.getAttribute("usuario");

				if (usuario != null) {
			%>
			<br/><br/><br/><br/>
			<table border="1" id="tabcampos">
				<tr>
					<td>Nome</td>
					<td>Usuário</td>
					<td>CPF</td>
				</tr>
				<%
					if (usuario != null) {
							out.println("<TR>");

							out.println("<TD>" + usuario.getNome() + "</TD>");
							out.println("<TD>" + usuario.getUserID() + "</TD>");
							out.println("<TD>" + usuario.getCPF() + "</TD>");

							out.println("</TR>");
						} else {
							out.println("</TR><TD> <BR> </TD> <TD> <BR> </TD> </TR>");
							out.println("</TR><TD> <BR> </TD> <TD><BR></TD></TR>");
						}
				%>
			</table>
			<%
				}
			%>
		</div>
	</div>
	<jsp:include page="Rodape.jsp" />
</body>
</html>